package sqlToGUI.testing.sendingInput;

import java.util.LinkedList;

public class WeatherDataCreator extends DataCreator{

	private LinkedList <Character>buff;

	private int humidity = 3400;
	private int temperature = 2000;
	private int windDirection = 1000;
	private int windSpeed = 3000;
	
	private String humidityS;
	private String temperatureS;
	private String windDirectionS;
	private String windSpeedS;
	
	public WeatherDataCreator(LinkedList <Character>buff){
		this.buff = buff;
	}
	
	public void update(){

		humidityS = fixDataLength(humidity + "", inputLength);
		temperatureS = fixDataLength(temperature + "", inputLength);
		windDirectionS = fixDataLength(windDirection + "", inputLength);
		windSpeedS = fixDataLength(windSpeed + "", inputLength);
		
		buff.add('$'); buff.add('#');
		buff.add('6'); buff.add('1');
		buff.add(humidityS.charAt(0));
		buff.add(humidityS.charAt(1));
		buff.add(humidityS.charAt(2));
		buff.add(humidityS.charAt(3));
		
		buff.add('$'); buff.add('#');
		buff.add('6'); buff.add('2');
		buff.add(temperatureS.charAt(0));
		buff.add(temperatureS.charAt(1));
		buff.add(temperatureS.charAt(2));
		buff.add(temperatureS.charAt(3));
		
		buff.add('$'); buff.add('#');
		buff.add('6'); buff.add('3');
		buff.add(windDirectionS.charAt(0));
		buff.add(windDirectionS.charAt(1));
		buff.add(windDirectionS.charAt(2));
		buff.add(windDirectionS.charAt(3));
		
		buff.add('$'); buff.add('#');
		buff.add('6'); buff.add('4');
		buff.add(windSpeedS.charAt(0));
		buff.add(windSpeedS.charAt(1));
		buff.add(windSpeedS.charAt(2));
		buff.add(windSpeedS.charAt(3));
	}
}